package com.sogoodsoft.service.exp;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DBHelper {
	protected static String oraDriver = "oracle.jdbc.driver.OracleDriver";
	protected static String oraUser = "sogoodsoft";
	protected static String oraPasswd = "sogoodsoft";
	protected static String oraUrl = "jdbc:oracle:thin:@127.0.0.1:1521:orcl";
	
	protected static String mysqlDriver = "com.mysql.jdbc.Driver";
	protected static String mysqlUser="sogoodsoft";
	protected static String mysqlPasswd = "sogoodsoft";
	protected static String mysqlUrl = "jdbc:mysql://localhost/sogoodsoft?useUnicode=true&characterEncoding=utf-8";
	
	protected static Connection ora;
	protected static Statement oraState;
	protected static ResultSet oraRS;
	
	protected static Connection mysql;
	protected static Statement mysqlState;
	protected static ResultSet mysqlRS;
	
	public static Logger logger = LoggerFactory.getLogger(DBHelper.class);
	
	public static void connect(){
		try {
			Class.forName(oraDriver);
			ora = DriverManager.getConnection(oraUrl, oraUser, oraPasswd);
			
			Class.forName(mysqlDriver);
			mysql = DriverManager.getConnection(mysqlUrl, mysqlUser, mysqlPasswd);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
